//
//  FMDBManage.h
//  ITHome
//
//  Created by lanou3g on 15/7/18.
//  Copyright (c) 2015年 YAX. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "FMDB.h"
#import "FMDBManageModel.h"

@interface FMDBManage : NSObject

/**
 *  收藏文字信息数据表
 */
+ (void)creatTable;
+ (NSMutableArray *)showAllUrlID;
+ (void)insertOneInfo:(NSString *)urlId shareTitle:(NSString *)shareTitle created_at:(NSString *)created_at urlString:(NSString *)urlString commentsCount:(NSString *)commentsCount shareImageUrl:(NSString *)shareImageUrl;
+ (void)deleteOneInfoWithUrlId:(NSString *)urlId;
+ (FMDBManageModel *)getOneInfoWithUrlID:(NSString *)urlID;
+ (NSMutableArray *)getAllInfo;
+ (void)deleteAllInfo;

/**
 *  用户信息
 */
+ (void)createUserInfoTable;

+ (BOOL)insertUserInfoOpenId:(NSString *)openId city:(NSString *)city figureurl_qq_1:(UIImage *)figureurl_qq_1 figureurl_qq_2:(UIImage *)figureurl_qq_2 gender:(NSString *)gender province:(NSString *)province nickname:(NSString *)nickname indirect:(NSString *)indirect;

+ (NSMutableArray *)selectAllUserInfo;

+ (void)deleteAllUserInfo;

+ (BOOL)updateUserInfoWithOpenId:(NSString *)openId city:(NSString *)city province:(NSString *)province figureurl_qq_2:(UIImage *)figureurl_qq_2 nickname:(NSString *)nickname indirect:(NSString *)indirect;


#pragma mark - --------------- 离线缓存数据表 ---------------
/**
 *  基本（通用)
 *
 *  @param tabelName 表名
 */
+ (void)createDatabaseTabel:(NSString *)tabelName;
+ (BOOL)insertCacheTable:(NSString *)tableName Title:(NSString *)title created_at:(NSString *)created_at replies_count:(NSString *)replies_count featureImageUrl:(NSString *)featureImageUrl;
+ (NSMutableArray *)selectAllDatabaseTable:(NSString *)tableName;
+ (void)deleteAllDatabaseTable:(NSString *)tableName;

//  注：查询移动互联模块的数据 因为model不同 所以写了一个单独的查询方法
+ (NSMutableArray *)selectAllRecentCacheTabel:(NSString *)tableName;



/**
 *  视频资讯
 */
+ (void)createTVTable;
+ (BOOL)insertTVTableTitle:(NSString *)title videoTime:(NSString *)videoTime videoImageUrl:(NSString *)videoImageUrl;
+ (NSMutableArray *)selectAllTVTable;
+ (void)deleteAllTVTable;


/**
 *  段子
 */
+ (void)createJokeTable;

+ (BOOL)insertJokeTableContent:(NSString *)content login:(NSString *)login down:(NSString *)down up:(NSString *)up;

+ (NSMutableArray *)selectAllJokeTable;

+ (void)deleteAllJokeTable;


/**
 *  娱乐视频
 */
+ (void)createVideoTable;

+ (BOOL)insertVideoTableTitle:(NSString *)title videoTime:(NSString *)videoTime playCount:(NSString *)playCount replyCount:(NSString *)replyCount;

+ (NSMutableArray *)selectAllVideoTable;

+ (void)deleteAllVideoTable;

@end
